<% if (session.getAttribute("ingelogd") == null || session.getAttribute("ingelogd").equals("nee")) {
     response.sendRedirect("login.jsp");
   }%>
<%
if (request.getParameter("a")!=null){
  //pas (de-)blokkeren
   String tabelNaam = "b_pinpassen";
   eskuel.CMI_SQL sql = new eskuel.CMI_SQL(pak.Db.dbhost, pak.Db.dbname, pak.Db.dbpass);
   String sqlQuery = "SELECT * FROM cmi0806683." + tabelNaam + " WHERE `Pasnummer` = '" + request.getParameter("a") + "'";
   java.sql.ResultSet res = sql.selectieQuery(sqlQuery);
   System.out.println(sqlQuery);
   String dePogingenInDB = "";
   while (res.next()) {
     dePogingenInDB = res.getString("Pogingen");
     System.out.println(dePogingenInDB);
   }
   if (dePogingenInDB == null || dePogingenInDB.equals(null) || dePogingenInDB.equals("0")|| dePogingenInDB.equals("1")|| dePogingenInDB.equals("2")) {
    sql.updateQuery("UPDATE `cmi0806683`.`"+tabelNaam+"` SET `Pogingen` = '3' WHERE `Pasnummer` = '"+request.getParameter("a")+"'");
   } else {
    sql.updateQuery("UPDATE `cmi0806683`.`"+tabelNaam+"` SET `Pogingen` = '0' WHERE `Pasnummer` = '"+request.getParameter("a")+"'");
   }
   response.sendRedirect("Overzicht pinpassen.jsp");
     //Redirect naar het OVerzicht

}
%>